package Homework2;

import java.util.Scanner;

public class Homework2_2 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        String str = input.nextLine();
        StringBuilder c = new StringBuilder();
        for (int i = 0; i < str.length(); i++){
            char s = str.charAt(i);
            if (Character.isLowerCase(s)){
                c.append(Character.toUpperCase(s));
            } else if (Character.isUpperCase(s)){
                c.append(Character.toLowerCase(s));
            }else {
                c.append(s);
            }
        }
        System.out.println(c);
    }
}
